//go:build windows

package nginx

import "os/exec"

func execTest(execPath, p string) (error, string) {
	c := exec.Command(execPath, "-p", p, "-t")
	o, e := c.Output()
	return e, string(o)

}

func execStart(execPath, p string) (error, string) {
	c := exec.Command(execPath, "-p", p)
	// windows 下 domain on 不好使
	e := c.Start()
	if e != nil {
		return e, ""
	}
	return nil, ""
}

func execStop(execPath, p string) (error, string) {
	c := exec.Command(execPath, "-p", p, "-s", "stop")
	o, e := c.Output()
	return e, string(o)
}
func execReload(execPath, p string) (error, string) {
	c := exec.Command(execPath, "-p", p, "-s", "reload")
	o, e := c.Output()
	return e, string(o)
}
